﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DSTMEETING.Win.App
{
    public class Config
    {
        private static Config s_instance = new Config();
        public static Config Instance
        {
            get
            {
                return s_instance;
            }
        }

        public string ServerBaseUrl { get; set; }

        public string StorageTemp { get; set; }

        /// <summary>
        /// 从app.config里读取配置信息
        /// </summary>
        public void LoadFromAppConfig()
        {
            ServerBaseUrl = System.Configuration.ConfigurationManager.AppSettings["DST.ServerBaseUrl"];
            StorageTemp = System.Configuration.ConfigurationManager.AppSettings["DST.Storage.Temp"];
            if(StorageTemp.StartsWith("~"))
            {
                StorageTemp = StorageTemp.Replace("~", AppDomain.CurrentDomain.BaseDirectory);
            }
        }
    }
}
